package Exe;

import java.util.*;

public class Exe1Vote {
    public static void main(String[] args) {
        String []arr={"A","B","C","D"};
        ArrayList<String> list=new ArrayList<>();
        Random r=new Random();
        for(int i=0;i<80;i++){
            int i1 = r.nextInt(4);
            list.add(arr[i1]);
        }

        HashMap<String,Integer> map=new HashMap<>();
        list.forEach(s1->{
            if(!map.containsKey(s1)){
                map.put(s1,1);
            }else{
                int i=map.get(s1);
                i++;
                map.put(s1,i);
            }
        });

        int max=0;
        Set<Map.Entry<String,Integer>> ft=map.entrySet();
        for (Map.Entry<String, Integer> entry : ft) {
            if(entry.getValue()>max){
                max= entry.getValue();
            }
        }

        for (Map.Entry<String, Integer> entry : ft) {
            if(entry.getValue()==max){
                System.out.println(entry.getKey());
            }
        }





    }


}
